package com.qk.management.mapper;

import com.qk.entity.Role;
import org.apache.ibatis.annotations.*;

import java.util.List;

/**
 * @author 李智勇
 * @data 2025/10/4 16:44
 */
@Mapper
public interface RoleMapper {
    @Select("select * from role where label = #{roleLabel}")
    Role selectByLabel(String roleLabel);

    @Select("select * from role")
    List<Role> selectAll();

    @Delete("delete from role where id = #{id}")
    void deleteById(Integer id);

    void update(Role role);

    @Select("select * from role where id = #{id}")
    Role selectById(Integer id);

    List<Role> selectBypage(@Param("name") String name);

    @Insert("insert into role(name,label,remark,create_time,update_time) values(#{name},#{label},#{remark},#{createTime},#{updateTime})")
    void insert(Role role);
}
